package com.achievement.project.system.proranking.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.achievement.project.system.proranking.mapper.ProrankingMapper;
import com.achievement.project.system.proranking.domain.Proranking;
import com.achievement.project.system.proranking.service.IProrankingService;
import com.achievement.common.utils.text.Convert;

/**
 * 专业排名Service业务层处理
 *
 * @author zkai
 * @date 2021-05-10
 */
@Service
public class ProrankingServiceImpl implements IProrankingService
{
    @Autowired
    private ProrankingMapper prorankingMapper;

    /**
     * 查询专业排名
     *
     * @param id 专业排名ID
     * @return 专业排名
     */
    @Override
    public Proranking selectProrankingById(Long id)
    {
        return prorankingMapper.selectProrankingById(id);
    }

    /**
     * 查询专业排名列表
     *
     * @param proranking 专业排名
     * @return 专业排名
     */
    @Override
    public List<Proranking> selectProrankingList(Proranking proranking)
    {
        return prorankingMapper.selectProrankingList(proranking);
    }

    /**
     * 新增专业排名
     *
     * @param proranking 专业排名
     * @return 结果
     */
    @Override
    public int insertProranking(Proranking proranking)
    {
        return prorankingMapper.insertProranking(proranking);
    }

    /**
     * 修改专业排名
     *
     * @param proranking 专业排名
     * @return 结果
     */
    @Override
    public int updateProranking(Proranking proranking)
    {
        return prorankingMapper.updateProranking(proranking);
    }

    /**
     * 删除专业排名对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteProrankingByIds(String ids)
    {
        return prorankingMapper.deleteProrankingByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除专业排名信息
     *
     * @param id 专业排名ID
     * @return 结果
     */
    @Override
    public int deleteProrankingById(Long id)
    {
        return prorankingMapper.deleteProrankingById(id);
    }

    @Override
    public List<Map<String, Object>> getCourseAvgPoint(String semester) {
        return prorankingMapper.getCourseAvgPoint(semester);
    }

    @Override
    public List<Map<String, Object>> getCourseTypeAvgPoint(String semester) {
        return prorankingMapper.getCourseTypeAvgPoint(semester);
    }
}
